CMPS 160 Spring 2013: Rippling Waves

by Jessica Cheung

Description

This project models rippling water with a vertex displacement shader. In this method, we modify the y-coordinate of all coordinates passed into the vertex shader through a sine function.

ie. coordinate.y = ((sin ( 3 * (wave + coordinate.x/5.0)) ) + sin( 1 * (wave + (coordinate.z/8.0))) ) * 1.50 + vPosition.y;

This makes any object we pass into the vertex shader create a wavy or rippling effect.

This model also supports basic manipulation such as rotation, scaling, and translation. After creating the mesh outline of waves, I added texture mapping onto the surface. (The importing of the texture image was conveniently done with the SOIL library)

User's Guide

To switch between wire frame and texture, toggle 'w'.
To rotate the model, click 'r' and use the arrow keys and mouse clicks to navigate.
To scale the model, click 's' and use the left and right mouse clicks to navigate.
To translate the model, click 't' and use the arrow keys and mouse clicks to navigate.
To exit the program, click 'esc'.